import {NgModule} from '@angular/core';
import {RouterModule, Routes} from '@angular/router';
import {AdminGuard} from './lib/service/admin-guard.service';
import {MainGuard} from './lib/service/main-guard.service';
import {MemberGuard} from './lib/service/member-guard.service';
import {AdminComponent} from './admin/admin.component';
import {MainComponent} from './main/main.component';
import {MemberComponent} from './member/member.component';
import {IndexComponent} from './home/index.component';
import {TuikeGuard} from "./lib/service/tuike-guard.service";
import {TuikeComponent} from "./tuike/tuike.component";

const routes: Routes = [
  {
    path: '',
    redirectTo: '/login',
    pathMatch: 'full'
  },
  {
    path: 'member',
    component: MemberComponent,
    canActivateChild: [MemberGuard],
    children: [
      {path: '', loadChildren: 'app/member/member.module#MemberModule'}
    ]
  }
];

@NgModule({
  imports: [
    RouterModule.forRoot(routes)
  ],
  exports: [
    RouterModule
  ],
  // providers: [ MyTodoGuard , OauthService ]
})
export class AppRoutingModule {
}
